import request from '@/utils/request'

// 获取协议列表
export function getAgreementList(params) {
  return request({
    url: '/api/agreement/list',
    method: 'get',
    params
  })
}

// 获取协议详情
export function getAgreementDetail(id) {
  return request({
    url: `/api/agreement/detail/${id}`,
    method: 'get'
  })
}

// 创建协议
export function createAgreement(data) {
  return request({
    url: '/api/agreement/create',
    method: 'post',
    data
  })
}

// 更新协议
export function updateAgreement(id, data) {
  return request({
    url: `/api/agreement/update/${id}`,
    method: 'put',
    data
  })
}

// 删除协议
export function deleteAgreement(id) {
  return request({
    url: `/api/agreement/delete/${id}`,
    method: 'delete'
  })
}

// 更新协议状态
export function updateAgreementStatus(id, status) {
  return request({
    url: `/api/agreement/status/${id}`,
    method: 'put',
    data: { status }
  })
} 